
<h1><?php echo $title; ?></h1>
<table class="list" cellpadding=3 >
	<thead>
		<tr>
				<th width="3%" class="center">#</th>
				<th><?php echo anchor('adozioni/contabilita/offerte/annuali/order_by/id_adozione', __("Scheda", $module), array('id' => 'id_adozione'))?></th>
				<th><?php echo anchor('adozioni/contabilita/offerte/annuali/order_by/s.nomecognome',__("Sostenitore", $module), array('id' => 's.nomecognome'))?></th>
				<th><?php echo anchor('adozioni/contabilita/offerte/annuali/order_by/a.nomecognome',__("Assistito", $module), array('id' => 'a.nomecognome'))?></th>
				<?php for($i = 1; $i <= 12; $i++): ?>
                <?php if(isset($filter['mese'][$i])): ?>
				<th><?php echo $nome_mese[ $i ] ?></th>
                <?php endif; ?>
				<?php endfor; ?>
				<th ><?php echo __("Totale", $module)?></th>
		</tr>
	</thead>
	<tbody>
<?php if (count($rows) > 0) : ?>
<?php $i = 1; foreach ($rows as $row): ?>
<?php if ($i % 2 != 0): $rowClass = 'odd'; else: $rowClass = 'even'; endif;?>
		<tr class="<?php echo $rowClass?>">
				<td class="center"><?php echo $i?></td>
				<td><?php echo $row['id_adozione'] ?></td>
				<td><?php echo $row['sostenitore'] ?></td>
				<td><?php echo $row['assistito'] ?></td>
				<?php for($j = 1; $j <= 12; $j++): ?>
                <?php if(isset($filter['mese'][$j])): ?>
				<td align="right" <?php echo (isset($row[ 'mese'.$j ])?'': 'style="color: #AAAAAA"')?> ><?php echo format_euro(isset($row[ 'mese'.$j ])?$row[ 'mese' .$j]: '0') ?></td>
				<?php endif; ?>
				<?php endfor; ?>
				<td align="right" class="total"><?php echo format_euro($row['totale_anno']) ?></td>
		</tr>
<?php $i++; endforeach; ?>
		<tr class="total">
				<td colspan=4><?php echo __("Totale", $module) ?></td>
				<?php for($j = 1; $j <= 12; $j++): ?>
                <?php if(isset($filter['mese'][$j])): ?>
				<td align="right"><?php echo format_euro($totale_mensile[ $j ]) ?></td>
                <?php endif; ?>
				<?php endfor; ?>
				<td align="right"><?php echo format_euro($totale_generale) ?></td>
		</tr>
<?php endif; ?>
</tbody>
</table>	